package org.evarela.persistence2.service;

import java.util.List;

import org.evarela.persistence2.dao.EmployeeDao;
import org.evarela.persistence2.entity.EmployeeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class EmployeeManagerImpl implements EmployeeManager {
 
    @Autowired
        private EmployeeDao employeeDao;
 
    @Override
    @Transactional
    public void addEmployee(EmployeeEntity employee) {
        employeeDao.addEmployee(employee);
    }
 
    @Override
    @Transactional
    public List<EmployeeEntity> getAllEmployees() {
        return employeeDao.getAllEmployees();
    }
 
    @Override
    @Transactional
    public void deleteEmployee(Integer employeeId) {
        employeeDao.deleteEmployee(employeeId);
    }
 
    public void setEmployeeDao(EmployeeDao employeeDao) {
        this.employeeDao = employeeDao;
    }
}
